import { createApp } from 'vue'

import './style.css'
import App from './App.vue'
import pinia, { useRouteStore } from "./piniaStore/index";
import router from './router';
import echarts from './views/admin/echart/echart';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import { Loading } from 'vant'
// 自定义loading组件




// 这里导出app的目的，是为了在后面演示js文件中使用插件
const app = createApp(App);
app.config.globalProperties.$echarts = echarts
import getRoutes from './grants/router';

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// app.use(Loading)
app.use(pinia);
const routeStore = useRouteStore()
if (sessionStorage.getItem("grants")) {
    getRoutes();
    routeStore.setIsAddRoute(true);
}
app.use(router);

app.mount('#app')


